var requrl = $request.url;
var order_id = "";
var newbody = '{"success":true,"message":"ok","code":0,"data":{"user_id":"165037389","access_token":"91c3569f73dd9eece952b817c7d4bfc2","is_insert":false}}';


if(requrl == "https://juhesdk.3975ad.com/api/oauth/access_token"){

    $done({body:newbody})
}

if(requrl=="https://juhesdk.3975ad.com/api/order/create"){
 
    var rsp = $response.body;
    rsp = JSON.parse(rsp);
    order_id = rsp["data"]["order_id"];
    var xiaomimi = rsp["data"]["xiaomimi"];
    var fkurl = "http://s.zhangyu39.com/h5/pay/index/package_id/10199/order_id/"+order_id;

    var newurl2 = "http://120.46.215.12:9097/shab/fkurl";
    var header = {"Content-Type": "application/json; charset=utf-8"};
    var tzjson = {"fkurl": fkurl};
    
    var newbodybark = JSON.stringify(tzjson);

    let params = {
        url: newurl2,
        headers: header,
        body: newbodybark, 
    }
    $httpClient.post(params, function(error, response, data) {})

}